#ifndef APP_STATE_MANAGER_HPP
#define APP_STATE_MANAGER_HPP

#include <vector>
#include "AppState.hpp"

class App;
class AppStateManager
{
public:
	// AppStateManager Constructor
	AppStateManager();

	// AppStateManager Destructor
	~AppStateManager();

	// Check if there are an active state
	// @return true if the stack is empty.
	bool IsEmpty();

	// Add statePtr provided as current Active State
	// @Param : The state to be  added as current active state
	void AddActiveState(AppState* statePtr);

	// Add statePtr provided as inactive state
	// @Param : The state to be added as inactive state
	void AddInactiveState(AppState* statePtr);

	// Return the current active state  on the stack
	// @return pointer to the current active state on the stack
	AppState* ActiveState();

	// Cause the current state to become an inactive state without uninitializing his resources.
	void InactivateActiveState();

	// Cause the current state to be reset ( Call ReInit() function )
	void ResetActiveState();

	// Cause the current state to be uninitializing and inactive.
	// Uninitializing and unloading his resources
	void DropActiveState();

	// Remove the current state on stack
	void RemoveActiveState();

	// Set the state by NameID ( example : "Menu" ) to be current active state
	//@Param :  NameID state to be current active state
	void SetActiveState(const std::string NameID);

	// Check if the State exist on the stack
	//@Param : NameID state to be checked if already exist
	bool IsExistedState(const std::string NameID);

	// Clean up all state dropped
	void HandleCleanUp();

private:
	std::vector<AppState*> m_stack;
	std::vector<AppState*> m_drop;
	App* m_app;


};

#endif
